<style>
    .layui-laypage li{float: left;}
    .layui-laypage .active span{background: #009688; color: #fff;}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>商品列表</legend>
</fieldset>
<div class="layui-row">
    <div class="layui-col-xs3">
        <div class="grid-demo grid-demo-bg1">
            <a href="{:url('addGoods')}" class="layui-btn layui-btn-sm">发布商品</a>
        </div>
    </div>
    <div class="layui-col-xs3">
        <div class="grid-demo">3/12</div>
    </div>
    <div class="layui-col-xs3">
        <div class="grid-demo grid-demo-bg1">3/12</div>
    </div>
    <div class="layui-col-xs3">
        <div class="grid-demo">3/12</div>
    </div>
</div>
<table class="layui-table">
    <colgroup>
        <col width="50">
        <col width="400">
        <col width="100">
        <col width="20">
        <col width="50">
        <col width="100">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>ID</th>
        <th>标题</th>
        <th>价格</th>
        <th>库存</th>
        <th>分类</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {volist name='list' id='g'}
    <tr>
        <td>{$g.goods_id}</td>
        <td>{$g.goods_title}</td>
        <td>{$g.goods_price}</td>
        <td>{$g.stock}</td>
        <td>{$g.cate.name}</td>
        <td>
            <a href="{:url('goodsEdit',['id'=>$g['goods_id']])}">修改</a>
            {if $g['goff'] eq 1}
            <a href="{:url('goodsOff',['id'=>$g['goods_id']])}">下架</a>
            {else}
            <a href="{:url('goodsUp',['id'=>$g['goods_id']])}" style="color: #f00">上架</a>
            {/if}
            <a href="{:url('goodsDel',['id'=>$g['goods_id']])}">删除</a>
        </td>
    </tr>
    {/volist}
    </tbody>
</table>

<ul class="layui-box layui-laypage layui-laypage-default">
    {$list|raw}
</ul>